<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp" %>
<%@ include file="/commons/validation.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="JavaScript"  src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var str="";
	function checkInput(thiz){
		if(thiz.value == null) return ;
		var reg = /^(0|([1-9]\d{0,9}))(\.\d{1,2})?$/g;
		return reg.test(thiz.value);
	}
	function validateInput(){
	    var flag = false;
		var objs1 = document.getElementsByName("waterMeter");
		for(var i =0 ; i < objs1.length;i++){
			if(!checkInput(objs1[i])){
			     flag = true;
				Alert("水表读数有问题,请输入小数位长度为2的非负正数!");
			    break;
			}
		}
		var objs2 = document.getElementsByName("ammeter");
		for(var i =0 ; i < objs2.length;i++){
			if(!checkInput(objs2[i])){
			     flag = true;
				Alert("电表读数有问题,请输入小数位长度为2的非负正数!");
			    break;
			}
		}
		return flag;
	}
	function buildStr(){
	    str = "";
	    var rows = $('ec_table').rows;
		for(var i = 0; i<rows.length;i++){
			var objs = rows[i].getElementsByTagName("INPUT");
			for(var j =0; j<objs.length;j++){
				str = str+objs[j].value;
				if(j!= objs.length-1)
					str = str+",";
			}
			str = str+";";
		}
		return str;
	}
</script>
</head>
<body>
<ec:ceTable items="meterDataList"
	action="${ctx}/occupation_joinHandleAction.do?method=initMeterDataList"
	var="meterDataItem"
	view="pmsNoPageView"
	styleClass="gridData2"
	rowsDisplayed="${totalRows }" >
	<ec:ceRow  styleClass="grid" >
		<c:choose>
			<c:when test="${status eq 'houseValidate'}">
				<ec:ceColumn width="8%" styleClass="align_left" headerCell="pmsHeadrCell" title="序号" property="sequence"  showTitle="false">
					<input type="hidden" name="keyword" value="${meterDataItem.keyword }" >${meterDataItem.sequence }
				</ec:ceColumn>
				<ec:ceColumn width="17%" styleClass="align_left" headerCell="pmsHeadrCell" title="房 号" property="houseNumber" showTitle="false" >
					<input type="hidden" name="houseId" value="${meterDataItem.houseId }" >
					<input type="hidden" name="houseNumber" value="${meterDataItem.houseNumber }" >${meterDataItem.houseNumber }
				</ec:ceColumn>
				<ec:ceColumn width="25%" styleClass="align_left" headerCell="pmsHeadrCell" title="管理房号" property="coalitionHouseNumber" showTitle="false">
					<input type="hidden" name="coalitionHouseNumber" value="${meterDataItem.coalitionHouseNumber }" >${meterDataItem.coalitionHouseNumber }
				</ec:ceColumn>
				<ec:ceColumn width="25%" styleClass="align_left" headerCell="pmsHeadrCell" title="水表读数(m3)" property="#" showTitle="false">
					<input type="hidden" name="waterMeterId" value="${meterDataItem.waterMeterId }" size="4" onblur="">
					<c:choose>
						<c:when test="${empty meterDataItem.waterMeterId}">
							<input type="text" name="waterMeter" value="${meterDataItem.waterMeter }" size="4" onblur="" readonly="readonly">
						</c:when>
						<c:when test="${not empty meterDataItem.waterMeterId}">
							<input type="text" name="waterMeter" value="${meterDataItem.waterMeter }" size="4" onblur="">
						</c:when>
					</c:choose>
				</ec:ceColumn>
				<ec:ceColumn width="25%" styleClass="align_left" headerCell="pmsHeadrCell" title="电表读数(度)" property="#" showTitle="false">
					<input type="hidden" name="ammeterId" value="${meterDataItem.ammeterId }" size="4" onblur="">
					<c:choose>
						<c:when test="${empty meterDataItem.ammeterId}">
							<input type="text" name="ammeter" value="${meterDataItem.ammeter }" size="4" onblur="" readonly="readonly">
						</c:when>
						<c:when test="${not empty meterDataItem.ammeterId}">
							<input type="text" name="ammeter" value="${meterDataItem.ammeter }" size="4" onblur="">
						</c:when>
					</c:choose>

				</ec:ceColumn>
			</c:when>
			<c:when test="${status eq 'detail' }">
				<ec:ceColumn width="8%" styleClass="align_left" headerCell="pmsHeadrCell" title="序号" property="sequence" />
				<ec:ceColumn width="17%" styleClass="align_left" headerCell="pmsHeadrCell" title="房 号" property="houseNumber" />
				<ec:ceColumn width="25%" styleClass="align_left" headerCell="pmsHeadrCell" title="管理房号" property="coalitionHouseNumber"/>
				<ec:ceColumn width="25%" styleClass="align_left" headerCell="pmsHeadrCell" title="水表读数(m3)" property="waterMeter" />
				<ec:ceColumn width="25%" styleClass="align_left" headerCell="pmsHeadrCell" title="电表读数(度)" property="ammeter" />
			</c:when>
		</c:choose>
	</ec:ceRow>
</ec:ceTable>
</body>
</html>